package com.beiye.drivertransport.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.android.frame.adapter.CommonAdapter;
import com.android.frame.adapter.ViewHolder;
import com.beiye.drivertransport.R;
import com.beiye.drivertransport.bean.CheckDateBean;

import java.text.SimpleDateFormat;
import java.util.List;

/**
 * Created by ky on 2018/1/10.
 */


public class PopWindowDateApt extends CommonAdapter<CheckDateBean.RowsBean> {
    private Context context;
    private List<CheckDateBean.RowsBean> mList;
    public PopWindowDateApt(Context context, List<CheckDateBean.RowsBean> mList, int itemLayoutId) {
        super(context, mList, itemLayoutId);
        this.context = context;
        this.mList = mList;
    }

    @Override
    public void convert(ViewHolder holder, CheckDateBean.RowsBean item, int positon) {
        TextView tv_checkdate =(TextView)holder.getView(R.id.tv_checkdate4);
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM");
        String format = df.format(System.currentTimeMillis());
        if(item!=null)
        {

            if(format.equals(item.getSetYm()))
            {
                tv_checkdate.setText("学习 "+item.getSetYm());
            }else{

                tv_checkdate.setText("补学 "+item.getSetYm());
            }
        }else{
            tv_checkdate.setVisibility(View.GONE);

        }

    }


}